﻿'/**********************************************************************
'/// <summary>
'// Name of File     :   UploadEDS.cs
'// Author           :   Sukhminder Singh
'// Create date      :   15th Nov 2011
'/// </summary>
'************************************************************************/

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
Imports Crystal.CLL
Imports Crystal.CustomControls
Imports CrystalDataHub.View
Imports System.ComponentModel
Imports System
Imports CrystalDataHub.BLL
Imports CrystalDataHub.BLL.CrystalDataHub.BLL
Imports Crystal.CommonDBManagement
Imports Crystal.CLL.CommonCLL
Imports System.Configuration

Public Class Home
    Inherits BaseForm

#Region "Fields"
    Private mstrScreenName As String = "Administration - EDS"
#End Region

#Region "Constructors"

    Public Sub New()
        InitializeComponent()
    End Sub

#End Region

#Region "On Load"

    Private Sub UploadEDS_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try
            Dim login As New CrystalCommon.View.Login()
            login.ShowDialog()
            If CommonCLL.UserID = 0 Then
                Me.Close()
            End If
            SetControlProperties()
            mdlDataHubBLLCommon.mstrConnectionstring = CommonCLL.mstrConnectionstring
            'btnFinaliseList.PerformClick()
        Catch ex As Exception
            MessageBox.Show(ex.ToString)
            Me.FormulateAndLogError(ex, mstrScreenName, 0)
        End Try
    End Sub

    Private Sub SetControlProperties()
        Me.Text = TitleManager.GetTitle("Administration")
    End Sub

    Private Sub btnEDS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btneSource.Click
        Dim lfrmUploadeSource As UploadeSource = New UploadeSource()
        If CommonCLL.FocusOnExistingInstanceByName("UploadeSource") Then
            lfrmUploadeSource.WindowState = FormWindowState.Normal
            lfrmUploadeSource.menmScreenType = DataHubScreenType.eSource
            lfrmUploadeSource.Show()
            lfrmUploadeSource.BringToFront()
            lfrmUploadeSource.Focus()
            Me.WindowState = FormWindowState.Minimized
        End If
    End Sub

    Private Sub btnDataEntry_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDataEntry.Click
        Dim lfrmUploadeSource As UploadeSource = New UploadeSource()
        If CommonCLL.FocusOnExistingInstanceByName("UploadeSource") Then
            lfrmUploadeSource.WindowState = FormWindowState.Normal
            lfrmUploadeSource.menmScreenType = DataHubScreenType.DataEntry
            lfrmUploadeSource.Show()
            lfrmUploadeSource.BringToFront()
            lfrmUploadeSource.Focus()
            Me.WindowState = FormWindowState.Minimized
        End If
    End Sub

    Private Sub btnFinaliseList_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFinaliseList.Click
        Dim lfrmUploadeSource As UploadeSource = New UploadeSource()
        If CommonCLL.FocusOnExistingInstanceByName("UploadeSource") Then
            lfrmUploadeSource.WindowState = FormWindowState.Normal
            lfrmUploadeSource.menmScreenType = DataHubScreenType.FinalizeList
            lfrmUploadeSource.Show()
            lfrmUploadeSource.BringToFront()
            lfrmUploadeSource.Focus()
            Me.WindowState = FormWindowState.Minimized
        End If
    End Sub

#End Region

#Region "Events"
    Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
        Me.Close()
    End Sub
#End Region

End Class